<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
    <style>
        .my-first{
            border: 1px solid orange;
        }
        .header{
            border: 1px solid olive;
        }
        .main{
            border: 1px solid darkorchid;
        }
        .footer{
            border: 1px solid tan;
        }
    </style>
<body>

    <div id="app">

        <my-first>
<!-- v-bind :  v-on @  v-slot # -->
            <template #default>
                <h1>Footer</h1>
            </template>

            <template #header>
                <h1>头部</h1>
            </template>

            <template v-slot:main>
                <h1>主体</h1>
            </template>

            

        </my-first>
    </div>

    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script>
        var app = Vue.createApp({
            data: function () {
                return {
                    num: 0
                }
            },

        })


        app.component('MyFirst', {
            template: `
            <div class="first-com">
                <header class="header">
                    <slot name="header"></slot>
                </header>
                <main class="main">
                    <slot name="main"></slot>
                </main>
                <footer class="footer">
                    <slot ></slot>
                </footer>
            </div>

            `,
        });

        app.mount('#app');
    </script>
</body>

</html>